<template>
  <div class="home">
    <van-tabbar
      v-model="active"
      route
      active-color="#2c83db"
      class="tabbar"
      v-if="$route.meta.needBar"
    >
      <van-tabbar-item to="/index">
        <template #icon>
          <van-icon name="home-o" />
        </template>
        主页
      </van-tabbar-item>
      <van-tabbar-item to="/search">
        <template #icon>
          <van-icon name="search" />
        </template>
        搜索
      </van-tabbar-item>
      <van-tabbar-item to="/video">
        <template #icon>
          <van-icon name="tv-o" />
        </template>
        视频
      </van-tabbar-item>
      <van-tabbar-item to="/my">
        <template #icon>
          <van-icon name="user-o" />
        </template>
        我的
      </van-tabbar-item>
    </van-tabbar>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'home',
  data () {
    return {
      active: 0
    }
  }
}
</script>

<style lang="less" scoped>
.home {
  .tabbar {
    font-size: 12px;
    color: #666666;
  }
}
</style>
